<template>
	<view>
	</view>
</template>

<script>
	const db = require('../js_sdk/index.js')
	export default {
		data() {
			return {}
		},
		onLoad() {
			let init = require('../test/init.js');
			let initprc = init(); //这里初始化引导页时用
			console.log(initprc)
			let readCol = db('coins_eth').where({
				id: 2
			}).find();
			console.log(readCol)
			let readVal = db('coins_eth').where({
				id: 1,
				symbol: 'ETH'
			}).value('token');
			console.log(readVal)
			db('coins_eth').update({
				isdef: 0
			});
			db('coins_eth').where({
				id: 2
			}).update({
				isdef: 1
			});
			let update = db('coins_eth').where({
				id: 2
			}).value('isdef');
			console.log(update)

			let data = {
				"id": 5,
				"token": "0xd850942ef8811f2a866692a623011bde52a462c1",
				"name": "VeChain",
				"isdef": "1",
				"symbol": "VEN",
				"ctype": "contract",
				"url": "https://www.vechain.org/",
				"desc": "",
				"img": "/static/coins/eth/ven.png",
				"abi": {},
				"decimals": "6"
			};
			db('coins_eth').insert([data]);
			let insert = db('coins_eth').where({
				symbol: 'VEN'
			}).find();
			console.log(insert);
			//db('coins_eth').where({id : 2}).delete();
			//let del = db('coins_eth').where({id : 2}).find();
			//console.log(del);
			let list = db('coins_eth').where({
				isdef: 1
			}).select();
			console.log(list)


		},
		methods: {

		}
	}
</script>

<style>
</style>